import smtplib
from email.mime.text import MIMEText
from email.header import Header
from email.mime.multipart import MIMEMultipart
# password='jxkphfbmbsmybiib'
# from_addr='340143745@qq.com'
# to_addr='340143745@qq.com'
# host='smtp.qq.com'
# port=465
# msg = MIMEText('hello, send by Python...', 'plain', 'utf-8')
# msg['From']=Header(from_addr)
# msg['To']=Header(to_addr)
# msg['Subject']=Header('来自python的问候...')
# smtp=smtplib.SMTP_SSL(host,port)
# smtp.login(from_addr,password)
# smtp.sendmail(from_addr,to_addr,msg.as_string())
# smtp.quit()
# print('发送成功')

password='jxkphfbmbsmybiib'
from_addr='340143745@qq.com'
to_addr='340143745@qq.com'
host='smtp.qq.com'
port=465
m1=MIMEMultipart()
msg = MIMEText('hello, send by Python...', 'plain', 'utf-8')
msg['From']=Header(from_addr)
msg['To']=Header(to_addr)
msg['Subject']=Header('来自python的问候...')

smtp=smtplib.SMTP_SSL(host,port)
smtp.login(from_addr,password)
smtp.sendmail(from_addr,to_addr,msg.as_string())
smtp.quit()
print('发送成功')